package com.fingard.dsp.bank.reqrespobj.elecbillquery;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RetAtsBase;
import com.fingard.dsp.bank.reqrespobj.elecbillquery.detail.RetAtsB013BilStateQryDetail;
import com.fingard.xml.XmlTextWriter;

/**
 * Created by dell on 2017/10/30.
 */
public class RetAtsB013BillStateQry extends RetAtsBase {

    public String respCode;
    public String respInfo;


    public RetAtsB013BillStateQry(ReqRespHeader p_header) {
        retHeader = p_header;
        retXmlWriter = new XmlTextWriter();//用于输出返回ATS的XML报文
    }


    public void writeBefore() {
        writeStart();//写返回ATS的统一头部信息
        retXmlWriter.writeElementString("RespCode", respCode);
        retXmlWriter.writeElementString("RespInfo", respInfo);
    }

    public void writeAfter() {
        writeEnd();
    }

    public void writeDetail(RetAtsB013BilStateQryDetail DB001Detail) {
        retXmlWriter.writeStartElement("DetailRecord");
        retXmlWriter.writeElementString("BillNo", DB001Detail.billNo);
        retXmlWriter.writeElementString("ContractNo", DB001Detail.contractNo);
        retXmlWriter.writeElementString("InvoiceNo", DB001Detail.invoiceNo);
        retXmlWriter.writeElementString("BillType", DB001Detail.billType);
        retXmlWriter.writeElementString("BillClass", DB001Detail.billClass);//????
        retXmlWriter.writeElementString("IssDate", DB001Detail.issDate);
        retXmlWriter.writeElementString("DueDate", DB001Detail.dueDate);
        retXmlWriter.writeElementString("AccpDate", DB001Detail.accpDate);//????
        retXmlWriter.writeElementString("BillAmt", DB001Detail.billAmt);

        retXmlWriter.writeElementString("DrawName", DB001Detail.drawName);
        retXmlWriter.writeElementString("DrawCode", DB001Detail.drawCode);
        retXmlWriter.writeElementString("DrawAct", DB001Detail.drawAct);
        retXmlWriter.writeElementString("DrawBnkName", DB001Detail.drawBnkName);
        retXmlWriter.writeElementString("DrawBnkCode", DB001Detail.drawBnkCode);

        retXmlWriter.writeElementString("PayeeName", DB001Detail.payeeName);
        retXmlWriter.writeElementString("PayeeCode", DB001Detail.payeeCode);
        retXmlWriter.writeElementString("PayeeAct", DB001Detail.payeeAct);
        retXmlWriter.writeElementString("PayeeBnkName", DB001Detail.payeeBnkName);
        retXmlWriter.writeElementString("PayeeBnkCode", DB001Detail.payeeBnkCode);

        retXmlWriter.writeElementString("AccpName", DB001Detail.accpName);
        retXmlWriter.writeElementString("AccpCode", DB001Detail.accpCode);
        retXmlWriter.writeElementString("AccpAct", DB001Detail.accpAct);
        retXmlWriter.writeElementString("AccpBnkName", DB001Detail.accpBnkName);
        retXmlWriter.writeElementString("AccpBnkCode", DB001Detail.accpBnkCode);

        retXmlWriter.writeElementString("TransFlag", DB001Detail.transFlag);
        retXmlWriter.writeElementString("PayType", DB001Detail.payType);

        retXmlWriter.writeElementString("ApplyName", DB001Detail.applyName);
        retXmlWriter.writeElementString("ApplyCode", DB001Detail.applyCode);
        retXmlWriter.writeElementString("ApplyAct", DB001Detail.applyAct);
        retXmlWriter.writeElementString("ApplyBnkName", DB001Detail.applyBnkName);
        retXmlWriter.writeElementString("ApplyBnkCode", DB001Detail.applyBnkCode);

        retXmlWriter.writeElementString("ReceName", DB001Detail.receName);
        retXmlWriter.writeElementString("ReceCode", DB001Detail.receCode);
        retXmlWriter.writeElementString("ReceAct", DB001Detail.receAct);
        retXmlWriter.writeElementString("ReceBnkName", DB001Detail.receBnkName);
        retXmlWriter.writeElementString("ReceBnkCode", DB001Detail.receBnkCode);

        retXmlWriter.writeElementString("Memo", DB001Detail.memo);
        retXmlWriter.writeElementString("TransState", DB001Detail.transState);//????

        retXmlWriter.writeEndElement();
    }

}
